package com.gxa.sideParking.core.exception;

/**
 * 声明一个枚举, 例举所有的异常状态和异常信息
 */
public enum ErrorCode {
    // 枚举的常量字段: 常量名必须英文全大写
    SYSTEM_ERROR(50000,"服务器开小差了,请稍后再试"),
    EMPTY_DATA(50001,"没有查询到数据"),
    LOGIN_FAILED(50002,"登录失败"),
    EMPTY_USERNAME(50003,"用户名不能为空"),
    WRONG_PERMISSION(50004,"没有访问权限"),
    NULL_TOKEN(50005,"token不允许为空值"),
    EMPTY_GOODS(50006,"没有该商品"),
    WRONG_SECKILL(50007,"没有该秒杀商品"),
    FAILD_SECKILL(50008,"本次秒杀没成功,请再接再厉"),
    FAILD_UPDATE(50009,"修改失败"),
    ;

    private Integer code;
    private String message;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    ErrorCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    ErrorCode() {
    }
}
